package utils

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

// 定义数据的返回结构体
type SqlResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

func Json(code int, msg string, data interface{}, c *gin.Context) {
	var Response SqlResponse
	Response.Code = code
	Response.Message = msg
	Response.Data = data
	c.JSON(http.StatusOK, Response)
}
